<template>
	<div class="clearfloat padding-across-10" style="height:100%;margin-bottom: 100px" v-loading="loading" element-loading-text="拼命加载中">
		<div class="navList">
			<div>
				<el-button size="small" type="primary" @click="reloadDatas">
					<i v-if="!refreshObj.waitting" class="el-icon el-icon-eleg-icon_refresh el-icon--left"></i>
					<i v-else class="el-icon-loading" style="font-size:25px"></i>刷新
				</el-button>
				<el-button size="small" type="primary" @click="goMapSet">
					<i class="el-icon el-icon-eleg-icon_pin el-icon--left"></i>地理位置
				</el-button>
				<el-button size="small" type="danger" @click="openFailure">
					<i class="el-icon-eleg-icon_error-triangle el-icon--left"></i>故障记录
				</el-button>
				<el-button size="small" type="danger" @click="openExp">
					<i class="el-icon-eleg-icon_clipboard el-icon--left"></i>异常报告
				</el-button>
				<el-dropdown @command="handleCommand">
					<el-button size="small" type="primary">
						推送<i class="el-icon-caret-bottom el-icon--right"></i>
					</el-button>
					<el-dropdown-menu slot="dropdown">
						<el-dropdown-item command="r">推送绑定读者</el-dropdown-item>
						<el-dropdown-item command="b">推送绑定图书</el-dropdown-item>
					</el-dropdown-menu>
				</el-dropdown>
				<el-button :disabled="!IsOnLine" size="small" type="primary" @click="SyncDeviceUseSumary">
					<i v-if="!SyncObj.waitting" class="el-icon el-icon-eleg-icon_download el-icon--left"></i>
					<i v-else class="el-icon-loading"></i>同步
				</el-button>
				<el-button :disabled="!IsOnLine" size="small" type="danger" @click="resetPassword">
					<i v-if="!resetPwdObj.waitting" class="el-icon el-icon-setting el-icon--left"></i>
					<i v-else class="el-icon-loading"></i>重置密码
				</el-button>
			</div>
			<div>
				<el-tag type="gray" style="float: right;font-size:16px">
					<a style="cursor: pointer;" @click="returnDetail">还书次数：{{deviceUseSumaryData.returncount}}</a>
				</el-tag>
				<el-tag type="success" style="float: right;font-size:16px;margin-right: 5px">
					<a style="cursor: pointer;" @click="borrowDetail">借阅次数：{{deviceUseSumaryData.borrowcount}}</a>
				</el-tag>
				<el-tag type="primary" style="float: right;font-size:16px;margin-right: 5px">
					<a style="cursor: pointer;" @click="loginDetail">登录次数：{{deviceUseSumaryData.logincount}}</a>
				</el-tag>
				<span style="font-size: 15px;float: right">今日使用统计：</span>
			</div>
		</div>
		<el-row :gutter="15">
			<el-col :span="isMobile ? 24 : 24">
				<!-- 设备信息 -->
				<div class="bg-purple">
					<div class="panel-title">
						<span style="width: 30%">设备码：{{this.templateObj.sn}}</span>
						<span style="width: 40%;font-size: 13px;">(最后一次与服务器连接时间：{{pingTime}})</span>
						<img class="title-img" v-bind:src="imgTitleUrl">
					</div>
					<el-row style="box-shadow: 2px 2px 5px #888888;border: 1px solid #B0B0B0;">
						<el-col :span="isMobile ? 24 : 24">
							<el-table border style="width: 100%;margin-top: 1px" :data="devideInfoData">
								<el-table-column label="名称" align="center" prop="name">
								</el-table-column>
								<el-table-column label="型号" align="center" prop="model"></el-table-column>
								<el-table-column label="应用名称" align="center" prop="appname"></el-table-column>
								<el-table-column label="应用版本" align="center" prop="appver"></el-table-column>
								<el-table-column label="固件版本" align="center" prop="fwver"></el-table-column>
								<el-table-column label="状态" align="center">
									<template slot-scope="scope">
										<el-tag v-if="scope.row.online" type="success">
											<li class="el-icon-circle-check el-icon--left"></li>在线</el-tag>
										<el-tag v-else type="gray">
											<li class="el-icon-circle-close el-icon--left"></li>离线</el-tag>
									</template>
								</el-table-column>
							</el-table>
						</el-col>
					</el-row>
				</div>
			</el-col>
			<el-col :span="isMobile ? 24 : 12">
				<el-row :gutter="5">
					<!-- 监控 -->
					<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px">
						<div class="grid-content bg-purple">
							<div>
								<template>
									<div class="inner-section">
										<div v-if="machineCaptureDatas && machineCaptureDatas.length > 0">
											<el-carousel indicator-position="none" trigger="click" height="400px">
												<el-carousel-item v-for="item in machineCaptureDatas">
													<!--<img title="点击查看更多" v-bind:src="item.path" height="100%" width="100%" @click="goMachineCapture" />-->
													<div style="position:relative ">
														<div style="position:absolute; right: 0px; top:5px; color:#fff;background-color: #000;
																opacity: 0.5;font-size: 13px;border-radius: 3px;padding: 0px 5px;">{{item.time}}</div>
														<img title="点击查看更多" v-bind:src="item.path" height="390" width="100%" @click="goMachineCapture" />
													</div>
												</el-carousel-item>
											</el-carousel>
										</div>
										<img v-else v-bind:src="imgUrl" style="width: 100%;height: 370px;padding-top: 1px">
									</div>
								</template>
							</div>
						</div>
					</el-col>
					<!-- 设备 -->
					<el-col :span="isMobile ? 24 : 24">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">设备信息</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
							<el-row :gutter="5">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px;">
									<div class="grid-content1 bg-purple">
										<div class="detail-section" v-loading="restartObj.waitting">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-gears" style="color: #EE7942;padding-top: 10px;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right" style="text-align: center">
												<div>
													<el-button :disabled="!IsOnLine" type="success" size="small" @click="restart">重启</el-button>
												</div>
												<div>
													<el-button :disabled="!IsOnLine" type="danger" size="small" @click="close">关机</el-button>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px;">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-institution fa-2x" style="color: #13ce66"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">书架类型</small>
												</div>
												<div>
													<small v-if="configDatas.multibookrack === 0">左书架</small>
													<small v-if="configDatas.multibookrack === 1">右书架</small>
													<small v-if="configDatas.multibookrack === 2">双书架</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple" v-loading="remoteInventory.waitting">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-book fa-2x" style="color: #13ce66"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">在架图书</small>
													<a style="text-decoration: underline;cursor: pointer;font-size:13px;color :#20A0FF" @click="RemoteInventory">盘点</a>
												</div>
												<div>
													<a style="text-decoration: underline;cursor: pointer;font-size:13px;color :#20A0FF" @click="openBookInfo">{{bookCount}}册</a>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-users fa-2x" style="color: #13ce66"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">读者信息</small></div>
												<div>
													<a style="text-decoration: underline;cursor: pointer;font-size:13px;color :#20A0FF" @click="getReaderByDevice">查看</a>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-map fa-2x" style="color: #13ce66"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">管理区域</small></div>
												<div>
													<a style="text-decoration: underline;cursor: pointer;font-size:13px;color :#20A0FF" @click="getManagedDistricts">查看</a>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px;">
									<div class="grid-content1 bg-purple" style="background-color: #1a9624">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-envelope fa-2x" style="color:#93ff9c;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right" style="text-align: left;padding-left: 15px">
												<div><span style="font-weight: bold;color: white">消息服务</span></div>
												<div v-if="!isSanDaiWT">
													<span style="font-weight: bold;color: white">状态：{{statusDatas.mqttserver === 0 ? '打开' : '关闭'}}</span>
												</div>
												<div v-if="isSanDaiWT">
													<span style="font-weight: bold;color: white">状态：{{statusDatas.mqttstatus.code === 0 ? '已连接' : '未连接'}}</span>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<!--<el-col :span="isMobile ? 24 : 12" style="margin-top: 3px;">
											<div class="grid-content1 bg-purple">
												<div class="detail-section">
													<div class="section-left">
														<div class="detail-title">
															<i class="fa fa-credit-card fa-2x" style="color: #13ce66"></i>
														</div>
													</div>
													<div class="section-right">
														<div>
															<small style="font-weight: bold;">卡片类型</small>
														</div>
														<div>
															<small v-if="configDatas.supportcardtype != ''" style="">{{configDatas.supportcardtype}}</small>
															<small v-else style="">未知</small>
														</div>
													</div>
												</div>
											</div>
										</el-col>-->
							</el-row>
						</div>
					</el-col>
				</el-row>
			</el-col>
			<el-col :span="isMobile ? 24 : 12">
				<el-row :gutter="5">
					<!-- 录像 -->
					<!--<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px" v-if="this.templateObj.model !== 'WT01-02A'">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">录像</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
						</div>
						<el-row :gutter="5">
							<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
								<div class="grid-content1 bg-purple">
									<div class="detail-section" v-loading="configDatas.voiceWaitting">
										<div class="section-left">
											<div class="detail-title">
												<i v-if="!configDatas.enablevoice" class="fa fa-video-camera fa-2x" style="color: #13ce66"></i>
												<i v-else style="color: #999999" class="fa fa-video-camera fa-2x"></i>
											</div>
										</div>
										<div class="section-right">
											<div><small style="font-weight: bold;">录像开关</small></div>
											<div class="switch">
												<el-switch :disabled="!IsOnLine" v-model="configDatas.voiceSwitch" :width="68" on-color="#13ce66" :on-text="$t('message.on')" :off-text="$t('message.off')" @change="controlVoice()"></el-switch>
											</div>
										</div>
									</div>
								</div>
							</el-col>
							<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
								<div class="grid-content1 bg-purple">
									<div class="detail-section">
										<div class="section-left">
											<div class="detail-title">
												<i class="fa fa-folder fa-2x" style="color: #13ce66"></i>
											</div>
										</div>
										<div class="section-right">
											<div>
												<small style="font-weight: bold;">录像文件</small>
												<a style="float:right;font-size:13px;margin-top:3px;text-decoration:underline;cursor: pointer;color :#20A0FF" @click="openRecordFileSizeDialog()">设置</a>
											</div>
											<div>
												<small>大小(MB)：{{configDatas.recordfilesize}}</small>
											</div>
										</div>
									</div>
								</div>
							</el-col>
							<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
								<div class="grid-content1 bg-purple">
									<div class="detail-section">
										<div class="section-left">
											<div class="detail-title">
												<i class="fa fa-clock-o fa-2x" style="color: #13ce66"></i>
											</div>
										</div>
										<div class="section-right">
											<div>
												<small style="font-weight: bold;">录像时间</small>
												<a style="float:right;font-size:13px;margin-top:3px;text-decoration:underline;cursor: pointer;color :#20A0FF" @click="openRecordDurationDialog()">设置</a>
											</div>
											<div><small>间隔(Min)：{{configDatas.recordfileduration}}</small></div>
										</div>
									</div>
								</div>
							</el-col>
						</el-row>
					</el-col>-->
					<!-- 照明 -->
					<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">照明</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
						</div>
						<el-row :gutter="5">
							<!-- 这里要区分三代 -->
							<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px" v-if="!isSanDaiWT">
								<div class="grid-content1 bg-purple">
									<div class="detail-section" v-loading="statusDatas.lightWaitting">
										<div class="section-left">
											<div class="detail-title">
												<i v-if="!statusDatas.lightstatus" class="el-icon el-icon-eleg-icon_lightbulb" style="color: #13ce66;font-size:35px"></i>
												<i v-else class="el-icon el-icon-eleg-icon_lightbulb" style="font-size:35px;color:#999999"></i>
											</div>
										</div>
										<div class="section-right">
											<div><small style="font-weight: bold;">灯带</small></div>
											<div class="switch">
												<el-switch :disabled="!IsOnLine" v-model="statusDatas.lightSwitch" :width="68" on-color="#13ce66" :on-text="$t('message.on')" :off-text="$t('message.off')" @change="controlLight()"></el-switch>
											</div>
										</div>
									</div>
								</div>
							</el-col>
							<el-col :span="isMobile ? 24 : 6" style="margin-top: 3px" v-if="isSanDaiWT">
								<div class="grid-content1 bg-purple">
									<div class="detail-section" v-loading="statusDatas.ledstatus.waitting">
										<div class="section-left">
											<div class="detail-title">
												<i v-if="statusDatas.ledstatus.code === 0" class="el-icon el-icon-eleg-icon_lightbulb" style="color: #13ce66;font-size:35px"></i>
												<i v-else class="el-icon el-icon-eleg-icon_lightbulb" style="font-size:35px;color:#999999"></i>
											</div>
										</div>
										<div class="section-right">
											<div><small style="font-weight: bold;">灯带控制</small></div>
											<div class="switch">
												<el-switch :disabled="!IsOnLine" v-model="statusDatas.ledstatus.switch" :width="68" on-color="#13ce66" :on-text="$t('message.on')" :off-text="$t('message.off')" @change="controlLight()"></el-switch>
											</div>
										</div>
									</div>
								</div>
							</el-col>
							<el-col :span="isMobile ? 24 : 6" style="margin-top: 3px" v-if="isSanDaiWT">
								<div class="grid-content1 bg-purple">
									<div class="detail-section">
										<div class="section-left">
											<div class="detail-title">
												<i v-if="statusDatas.ledstatus.code === 0" class="el-icon el-icon-eleg-icon_lightbulb" style="color: #13ce66;font-size:35px"></i>
												<i v-else class="el-icon el-icon-eleg-icon_lightbulb" style="font-size:35px;color:#999999"></i>
											</div>
										</div>
										<div class="section-right">
											<div><small style="font-weight: bold;">灯带状态</small></div>
											<div>
												<small>
													<el-tag :title="statusDatas.ledstatus.msg" v-if="statusDatas.ledstatus.code === 0" type="success" style="max-width: 80px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">开启</el-tag>
													<el-tag :title="statusDatas.ledstatus.msg" v-if="statusDatas.ledstatus.code !== 0" type="danger" style="max-width: 80px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">关闭</el-tag>
												</small>
											</div>
										</div>
									</div>
								</div>
							</el-col>
							<el-col :span="isMobile ? 24 : 12" style="margin-top: 3px">
								<div class="grid-content1 bg-purple">
									<div class="detail-section" v-loading="configDatas.timingLightWaitting">
										<div class="section-left">
											<div class="detail-title">
												<i v-if="!configDatas.enabletiminglight" class="fa fa-clock-o fa-2x" style="color: #13ce66"></i>
												<i v-else style="color: #999999" class="fa fa-clock-o fa-2x"></i>
											</div>
											<div class="switch">
												<el-switch :disabled="!IsOnLine" v-model="configDatas.timingLightSwitch" :width="68" on-color="#13ce66" :on-text="$t('message.on')" :off-text="$t('message.off')" @change="controlTimingLight()"></el-switch>
											</div>
										</div>
										<div class="section-right">
											<div><small style="font-weight: bold;">定时开关灯</small></div>
											<div>
												<small>开灯时间:</small>&nbsp;&nbsp;
												<small>{{configDatas.lightontime}}</small>
												<a style="float:right;font-size:13px;margin-top:3px;text-decoration:underline;cursor: pointer;color :#20A0FF" @click="setLightOnTimeDialog()">设置</a>
											</div>
											<div>
												<small>关灯时间:</small>&nbsp;&nbsp;
												<small>{{configDatas.lightofftime}}</small>
												<a style="float:right;font-size:13px;margin-top:3px;text-decoration:underline;cursor: pointer;color :#20A0FF" @click="setLightOffTimeDialog()">设置</a>
											</div>
										</div>
									</div>
								</div>
							</el-col>
						</el-row>
					</el-col>
					<!-- 门锁  这里要区分三代-->
					<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">柜门门锁</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
							<el-row :gutter="5" v-if="!isSanDaiWT">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section" v-loading="controlLockObj.waitting">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.doorStatus" class="el-icon el-icon-eleg-icon_lock" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_lock-open" style="color: #ff4949;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">门锁</small></div>
												<div class="switch">
													<el-switch :disabled="!IsOnLine" v-model="statusDatas.doorSwitch" :width="68" on-color="#13ce66" off-color="#ff4949" on-text="上锁" off-text="开锁" @change="controlDoorLock()"></el-switch>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col style="margin-top: 3px" :span="isMobile ? 24 : 10" v-if="configDatas.multibookrack === 0 || configDatas.multibookrack === 2">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.doorStatus" class="el-icon el-icon-eleg-icon_lock" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_lock-open" style="color: #ff4949;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">A柜左门锁:
														<el-tag v-if="statusDatas.leftlockstatusA" type="danger">开锁</el-tag>
														<el-tag v-else type="success">上锁</el-tag>
													</small>
												</div>
												<div>
													<small style="font-weight: bold;">A柜右门锁:
														<el-tag v-if="statusDatas.rightlockstatusA" type="danger">开锁</el-tag>
														<el-tag v-else type="success">上锁</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col style="margin-top: 3px" :span="isMobile ? 24 : 9" v-if="configDatas.multibookrack === 1 || configDatas.multibookrack === 2">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.doorStatus" class="el-icon el-icon-eleg-icon_lock" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_lock-open" style="color: #ff4949;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">B柜左门锁:
														<el-tag v-if="statusDatas.leftlockstatusB" type="danger">开锁</el-tag>
														<el-tag v-else type="success">上锁</el-tag>
													</small>
												</div>
												<div>
													<small style="font-weight: bold;">B柜右门锁:
														<el-tag v-if="statusDatas.rightlockstatusB" type="danger">开锁</el-tag>
														<el-tag v-else type="success">上锁</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
							</el-row>
							<el-row :gutter="5" v-if="isSanDaiWT">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section" v-loading="controlLockObj.waitting">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="statusDatas.doorstatus.code === 1" class="el-icon el-icon-eleg-icon_lock" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_lock-open" style="color: #ff4949;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">门锁</small></div>
												<div class="switch">
													<el-switch :disabled="!IsOnLine" v-model="statusDatas.doorstatus.switch" :width="68" on-color="#13ce66" off-color="#ff4949" on-text="上锁" off-text="开锁" @change="controlDoorLock()"></el-switch>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 12" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="el-icon el-icon-eleg-icon_drawer" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">门锁状态</small>
												</div>
												<div>
													<el-tag :title="statusDatas.doorstatus.msg" v-if="statusDatas.doorstatus.code === 0" type="danger" style="max-width: 170px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">{{statusDatas.doorstatus.msg}}</el-tag>
													<el-tag :title="statusDatas.doorstatus.msg" v-if="statusDatas.doorstatus.code !== 0" type="success" style="max-width: 170px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">{{statusDatas.doorstatus.msg}}</el-tag>
												</div>
											</div>
										</div>
									</div>
								</el-col>
							</el-row>
						</div>
					</el-col>
					<!-- 柜门开关  这里三代不展示-->
					<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px" v-if="!isSanDaiWT">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">柜门状态</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
							<el-row :gutter="5">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px" v-if="configDatas.multibookrack === 0 || configDatas.multibookrack === 2">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.leftsensortatusA" class="el-icon el-icon-eleg-icon_drawer" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_drawer" style="font-size: 35px;color:#ff4949"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">A柜左门</small>
												</div>
												<div>
													<small>状态：
														<el-tag v-if="statusDatas.leftsensortatusA" type="danger">开启</el-tag>
														<el-tag v-else type="success">关闭</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px" v-if="configDatas.multibookrack === 0 || configDatas.multibookrack === 2">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.rightsensortatusA" class="el-icon el-icon-eleg-icon_drawer" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_drawer" style="font-size: 35px;color:#ff4949"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">A柜右门</small></div>
												<div>
													<small>状态：
														<el-tag v-if="statusDatas.rightsensortatusA" type="danger">开启</el-tag>
														<el-tag v-else type="success">关闭</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px" v-if="configDatas.multibookrack === 1 || configDatas.multibookrack === 2">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.leftsensortatusB" class="el-icon el-icon-eleg-icon_drawer" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_drawer" style="font-size: 35px;color:#ff4949"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">B柜左门</small></div>
												<div>
													<small>状态：
														<el-tag v-if="statusDatas.leftsensortatusB" type="danger">开启</el-tag>
														<el-tag v-else type="success">关闭</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px" v-if="configDatas.multibookrack === 1 || configDatas.multibookrack === 2">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.rightsensortatusB" class="el-icon el-icon-eleg-icon_drawer" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_drawer" style="font-size: 35px;color:#ff4949"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">B柜右门</small></div>
												<div>
													<small>状态：
														<el-tag v-if="statusDatas.rightsensortatusB" type="danger">开启</el-tag>
														<el-tag v-else type="success">关闭</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
							</el-row>
						</div>
					</el-col>
					<!-- 广告屏 -->
					<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">广告屏</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
							<el-row :gutter="5">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px" v-if="isSanDaiWT">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-adjust" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">广告屏状态</small>
												</div>
												<div>
													<el-tag :title="statusDatas.adstatus.msg" v-if="statusDatas.adstatus.code === 0" type="success" style="max-width: 170px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
													<el-tag :title="statusDatas.adstatus.msg" v-if="statusDatas.adstatus.code !== 0" type="danger" style="max-width: 170px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-shield" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">灯带阈值</small>
													<a style="float:right;font-size:13px;margin-top:3px;text-decoration:underline;cursor: pointer;color :#20A0FF" @click="setLedthreshold">设置</a>
												</div>
												<div><small>阈值：{{configDatas.ledthreshold}}</small></div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left" style="width: 30%">
												<div class="detail-title">
													<i class="el-icon-document" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right" style="width: 70%">
												<div>
													<small style="font-weight: bold;">发布内容</small>
												</div>
												<div style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"><small>{{configDatas.adScreenStr}}</small></div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 24" style="margin-top: 3px">
									<div class="grid-content1 bg-purple" v-loading="ledControlModelLoading">
										<div class="detail-section">
											<div class="section-left" style="width: 20%">
												<div class="detail-title">
													<i class="el-icon-setting" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right" style="width: 80%">
												<div>
													<small style="font-weight: bold;">灯带控制方式</small>
												</div>
												<div>
													<el-radio-group :disabled="!IsOnLine" v-model="configDatas.ledcontroltype" @change="selectControlModel">
														<el-radio :label="0">关闭自动控制</el-radio>
														<el-radio :label="1">定时控制</el-radio>
														<el-radio :label="2">读取光照传感器</el-radio>
													</el-radio-group>
												</div>
											</div>
										</div>
									</div>
								</el-col>
							</el-row>
						</div>
					</el-col>
					<!-- 其他信息  这里要区分三代【ok】-->
					<el-col :span="isMobile ? 24 : 24" style="padding-top: 5px">
						<div class="bg-purple">
							<div class="panel-title">
								<span style="width: 70%">其他信息</span>
								<img class="title-img" v-bind:src="imgTitleUrl">
							</div>
							<el-row :gutter="5" v-if="!isSanDaiWT">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.printerstatus" class="el-icon el-icon-eleg-icon_printer-alt" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_printer-alt" style="color: #ff6d6d;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">打印机</small>
												</div>
												<div>
													<small>电源：
														<el-tag v-if="statusDatas.printerpower" type="danger">关闭</el-tag>
														<el-tag v-else type="success">打开</el-tag>
													</small>
												</div>
												<div>
													<small>状态：
														<el-tag v-if="statusDatas.printerstatus === 1" type="danger">未连接</el-tag>
														<el-tag v-if="statusDatas.printerstatus === 2" type="danger">打印失败</el-tag>
														<el-tag v-if="statusDatas.printerstatus === 0" type="success">已连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.cardreaderstatus" class="el-icon el-icon-eleg-icon_id-2_alt" style="color: #13ce66;font-size: 35px"></i>
													<i v-else class="el-icon el-icon-eleg-icon_id-2_alt" style="color: #ff6d6d;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">读卡器</small>
												</div>
												<div>
													<small>电源：
														<el-tag v-if="statusDatas.cardreadpower" type="danger">关闭</el-tag>
														<el-tag v-else type="success">打开</el-tag>
													</small>
												</div>
												<div style="margin-top: 2px">
													<small>状态：
														<el-tag v-if="statusDatas.cardreaderstatus === 1" type="danger">未连接</el-tag>
														<el-tag v-if="statusDatas.cardreaderstatus === 0" type="success">已连接</el-tag>
														<el-tag v-if="statusDatas.cardreaderstatus === 2" type="danger">有卡</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="statusDatas.rfidreaderstatus === 0" class="fa fa-bullseye fa-2x" style="color: #13ce66"></i>
													<i v-else class="fa fa-bullseye fa-2x" style="color: #999999"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">RFID设备</small></div>
												<div style="margin-top: 2px">
													<small>状态：
														<el-tag v-if="statusDatas.rfidreaderstatus === 1" type="danger">关闭</el-tag>
														<el-tag v-if="statusDatas.rfidreaderstatus === 0" type="success">打开</el-tag>
														<el-tag v-if="statusDatas.rfidreaderstatus === 2" type="danger">扫描失败</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i v-if="!statusDatas.mainboardstatus" class="fa fa-window-restore fa-2x" style="color: #13ce66"></i>
													<i v-else style="color: #999999" class="fa fa-window-restore fa-2x"></i>
												</div>
											</div>
											<div class="section-right">
												<div><small style="font-weight: bold;">控制板</small></div>
												<div>
													<small>状态：
														<el-tag v-if="statusDatas.mainboardstatus" type="danger">关闭</el-tag>
														<el-tag v-else type="success">开启</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
							</el-row>
							<el-row :gutter="5" v-if="isSanDaiWT">
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class=" fa fa-camera" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">摄像头</small>
												</div>
												<div>
													<small>
														<el-tag :title="statusDatas.camerastatus.msg" v-if="statusDatas.camerastatus.code === 0" type="success" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
														<el-tag :title="statusDatas.camerastatus.msg" v-if="statusDatas.camerastatus.code !== 0" type="danger" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-id-card" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">读卡器设备</small>
												</div>
												<div>
													<small>
														<el-tag :title="statusDatas.rfiddevicestatus.msg" v-if="statusDatas.rfiddevicestatus.code === 0" type="success" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
														<el-tag :title="statusDatas.rfiddevicestatus.msg" v-if="statusDatas.rfiddevicestatus.code !== 0" type="danger" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-address-card" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">吞卡器设备</small>
												</div>
												<div>
													<small>
														<el-tag :title="statusDatas.cardswallowingdevicestatus.msg" v-if="statusDatas.cardswallowingdevicestatus.code === 0" type="success" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
														<el-tag :title="statusDatas.cardswallowingdevicestatus.msg" v-if="statusDatas.cardswallowingdevicestatus.code !== 0" type="danger" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-window-restore fa-2x" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">控制板设备</small>
												</div>
												<div>
													<small>
														<el-tag :title="statusDatas.controlboardstatus.msg" v-if="statusDatas.controlboardstatus.code === 0" type="success" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
														<el-tag :title="statusDatas.controlboardstatus.msg" v-if="statusDatas.controlboardstatus.code !== 0" type="danger" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="fa fa-bullseye fa-2x" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">刷卡器设备</small>
												</div>
												<div>
													<small>
														<el-tag :title="statusDatas.rfidreaderdevicestatus.msg" v-if="statusDatas.rfidreaderdevicestatus.code === 0" type="success" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
														<el-tag :title="statusDatas.rfidreaderdevicestatus.msg" v-if="statusDatas.rfidreaderdevicestatus.code !== 0" type="danger" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
								<el-col :span="isMobile ? 24 : 8" style="margin-top: 3px">
									<div class="grid-content1 bg-purple">
										<div class="detail-section">
											<div class="section-left">
												<div class="detail-title">
													<i class="el-icon el-icon-eleg-icon_printer-alt" style="color: #13ce66;font-size: 35px"></i>
												</div>
											</div>
											<div class="section-right">
												<div>
													<small style="font-weight: bold;">打印机设备</small>
												</div>
												<div>
													<small>
														<el-tag :title="statusDatas.printdevicestatus.msg" v-if="statusDatas.printdevicestatus.code === 0" type="success" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">已连接</el-tag>
														<el-tag :title="statusDatas.printdevicestatus.msg" v-if="statusDatas.printdevicestatus.code !== 0" type="danger" style="max-width: 100px;overflow: hidden;
															text-overflow:ellipsis;white-space: nowrap;">未连接</el-tag>
													</small>
												</div>
											</div>
										</div>
									</div>
								</el-col>
							</el-row>
						</div>
					</el-col>
				</el-row>
			</el-col>
		</el-row>

		<!-- 设备绑定的有效读者信息 -->
		<el-dialog title="设备绑定的有效读者信息" v-model="deviceReaderDialog">
			<el-table border style="width: 100%;" :data="deviceReaderDatas" @selection-change="handleSelectionChange">
				<el-table-column type="selection" align="center"></el-table-column>
				<el-table-column label="读者姓名" align="center" prop="name"></el-table-column>
				<el-table-column label="读者标签" align="center" prop="tag"></el-table-column>
				<el-table-column label="注册时间" align="center" prop="createdtime"></el-table-column>
			</el-table>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!pushReaderObj.waitting" type="primary" @click="pushReaderToDevice">推 送</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 红外测试弹窗 -->
		<el-dialog title="红外测试" v-model="adTestDialog" size='tiny'>
			<el-table border style="width: 100%;font-size: 10px;" :data="adTestData">
				<el-table-column type="index" align="center" width="100"></el-table-column>
				<el-table-column label="层号" align="center" prop="number"></el-table-column>
				<el-table-column label="值" align="center" prop="value"></el-table-column>
			</el-table>
		</el-dialog>
		<!-- 设置开灯时间 -->
		<el-dialog title="定时开灯时间" v-model="lightonDialog" size='tiny'>
			<span>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">当前开灯时间：</small>
					<small style="font-size:15px">{{setLightOnObj.lightontime}}</small>
				</div>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">选择开灯时间：</small>
					<el-time-picker format="HH:mm" v-model="lightOnTimeValue" placeholder="选择开灯时间">
					</el-time-picker>
				</div>
			</span>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!lightOnObj.waitting" type="primary" @click="changeLightOnTime">确 定</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 设置关灯时间 -->
		<el-dialog title="定时关灯时间" v-model="lightoffDialog" size='tiny'>
			<span>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">当前关灯时间：</small>
					<small style="font-size:15px">{{setLightOffObj.lightofftime}}</small>
				</div>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">选择关灯时间：</small>
					<el-time-picker format="HH:mm" v-model="lightOffTimeValue" placeholder="选择开灯时间">
					</el-time-picker>
				</div>
			</span>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!lightOffObj.waitting" type="primary" @click="changeLightOffTime">确 定</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 设置录像文件大小弹窗 -->
		<el-dialog title="录像文件大小" v-model="recordFileSizeDialog" :class="[dialog-tiny-width]">
			<span>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">当前录像文件大小：</small>
					<small style="font-size:15px">{{recordFileSizeObj.recordfilesize}}(MB)</small>
				</div>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">设置录像文件大小：</small>
					<el-input-number :min="1024" :max="4096" size="small" v-model="defaultRecordFileSize"></el-input-number>
				</div>
			</span>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!setRecordFileSizeObj.waitting" type="primary" @click="changeRecordFileSize">确 定</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 设置录像时间间隔 -->
		<el-dialog title="录像时间间隔" v-model="recordDurationDialog" :class="[dialog-tiny-width]">
			<span>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">当前录像时间间隔：</small>
					<small style="font-size:15px">{{recordDurationObj.recordfileduration}}(Min)</small>
				</div>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">设置录像时间间隔：</small>
					<el-input-number :min="5" :max="30" size="small" v-model="defaultRecordDuration"></el-input-number>
				</div>
			</span>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!setRecordDurationObj.waitting" type="primary" @click="changeRecordDuration">确 定</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 修改名称 -->
		<el-dialog title="设备重命名" v-model="renameDeviceDialog" :class="[dialog-tiny-width]">
			<span>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold;width: 25%">设备名称：</small>
					<el-input style="width: 73%" size="small" v-model="changeNameObj.deviceName"></el-input>
				</div>
			</span>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!changeNameObj.waitting" type="primary" @click="rename">确 定</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 设置广告灯阈值 -->
		<el-dialog title="灯带阈值设置" v-model="ledthresholdDialog" :class="[dialog-tiny-width]">
			<span>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">当前灯带阈值大小：</small>
					<small style="font-size:15px">{{ledthresholdObj.ledthreshold}}</small>
				</div>
				<div style="margin-top: 15px">
					<small style="font-size: 15px;font-weight: bold">设置灯带阈值大小：</small>
					<el-input-number :min="0" :max="254" size="small" v-model="ledthresholdObj.ledthreshold"></el-input-number>
				</div>
			</span>
			<span slot="footer" class="dialog-footer">
				<el-button v-if="!ledthresholdObj.waitting" type="primary" @click="changeLedthreshold">确 定</el-button>
				<i v-else class="el-icon-loading" style="font-size:25px"></i>
			</span>
		</el-dialog>
		<!-- 书架书籍信息 -->
		<el-dialog title="在架图书信息" v-model="bookInfoDialog" :class="[dialog-large-width]">
			<div style="width: 100%;padding-bottom: 3px">
				<span style="font-size: 13px;font-weight: bold">检索字段</span>
				<el-select size="small" v-model="value" :placeholder="$t('message.selectModeAlert')" style="width: 90px;margin-right: 2px">
					<el-option label="关键字" :value="0"></el-option>
					<el-option label="条码" :value="1"></el-option>
					<el-option label="标签" :value="2"></el-option>
				</el-select>
				<span style="font-size: 13px;font-weight: bold">关键字</span>
				<el-input size="small" style="width: 200px;" class="inline-input" v-model="searchModel" placeholder="请输入检索字段关键字">
					<el-button id="searchBookData" slot="append" icon="search" @click="findBookInfo"></el-button>
				</el-input>
				<el-button type="primary" size="small" @click="bindLocation"><i class="el-icon-eleg-icon_pin el-icon--left"></i>绑定馆藏地</el-button>
			</div>
			<el-table border style="width: 100%" :data="bookData" @selection-change="handleBookSelectionChange">
				<el-table-column type="selection" align="center"></el-table-column>
				<el-table-column label="书名" align="center" prop="name"></el-table-column>
				<el-table-column label="作者" align="center" prop="author"></el-table-column>
				<el-table-column label="条码" align="center" prop="barcode"></el-table-column>
				<el-table-column label="标签" align="center" prop="tag"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="馆藏地" align="center">
					<template slot-scope="scope">
						<span v-if="scope.row.location != null">{{scope.row.location}}</span>
						<el-tag v-else type="danger">未绑定</el-tag>
					</template>
				</el-table-column>
				<el-table-column label="位置" align="center" prop="position"></el-table-column>
				<el-table-column label="绑定时间" align="center" prop="bindtime"></el-table-column>
				<el-table-column label="状态" align="center">
					<template slot-scope="scope">
						<el-tag type="danger" v-if="scope.row.status === 1">丢失</el-tag>
						<el-tag type="warning" v-if="scope.row.status === 2">外借</el-tag>
						<el-tag type="success" v-if="scope.row.status === 3">在库</el-tag>
					</template>
				</el-table-column>
			</el-table>
			<div class="block" style="text-align:right;padding-bottom: 10px">
				<el-pagination @current-change="handleCurrentChange" @size-change="handleSizeChange" :current-page="currentPage" :page-size="pageSize" :page-sizes="[10,20,30,40,50]" layout="total,sizes,prev, pager, next, jumper" :total="totalSize">
				</el-pagination>
			</div>
		</el-dialog>
		<!-- 设置图书馆藏地 -->
		<el-dialog title="馆藏地列表" v-model="documentlocationDialog" :class="[dialog-large-width]">
			<el-table border style="width: 100%;" :data="locationDatas">
				<el-table-column label="" width="50">
					<template slot-scope="scope">
						<el-radio :label="scope.row.Name" v-model="locationName" @change.native="getCurrentRow(scope.row)">&nbsp;</el-radio>
					</template>
				</el-table-column>
				<el-table-column label="名称" align="center" prop="Name"></el-table-column>
				<el-table-column label="创建时间" align="center" prop="CreateTime"></el-table-column>
				<el-table-column label="创建人" align="center" prop="CreateUid"></el-table-column>
			</el-table>
			<div class="block" style="text-align: right;padding-top: 2px">
				<el-pagination @current-change="handleLocationCurrentChange" @size-change="handleLocationSizeChange" :current-page="locationCurrentPage" :page-size="locationPageSize" :page-sizes="[10,20,30,40,50]" layout="total,sizes, prev, pager, next, jumper" :total="locationTotalSize">
				</el-pagination>
			</div>
			<span slot="footer" class="dialog-footer">
				<el-button @click="documentlocationDialog = false">取 消</el-button>
				<el-button type="primary" @click="confirmBindLocation">确 定</el-button>
			</span>
		</el-dialog>
		<el-dialog title="今日登录详情" v-model="loginDetailDialog" :class="[dialog-large-width]">
			<el-table border style="width: 100%" :data="loginDetailDatas">
				<el-table-column type="index" align="center" width="50px"></el-table-column>
				<el-table-column label="名称" align="center" prop="readername"></el-table-column>
				<el-table-column label="读者证号" align="center" prop="readercode"></el-table-column>
				<el-table-column label="读者标签" align="center" prop="readertag"></el-table-column>
				<el-table-column label="登录时间" align="center" prop="time"></el-table-column>
				<el-table-column label="状态" align="center">
					<template slot-scope="scope">
						<el-tag type="success" v-if="scope.row.loginsuccess">登录成功</el-tag>
						<el-tag type="danger" v-else>{{scope.row.msg == null ? '登录失败' : scope.row.msg}}</el-tag>
					</template>
				</el-table-column>
			</el-table>
			<div class="block" style="text-align:right">
				<el-pagination @current-change="handleLoginCurrentChange" :current-page="loginCurrentPage" :page-size="loginPageSize" layout="total,prev, pager, next, jumper" :total="loginTotalSize">
				</el-pagination>
			</div>
		</el-dialog>
		<el-dialog title="今日借阅详情" v-model="borrowDetailDialog" :class="[dialog-large-width]">
			<el-table border style="width: 100%" :data="borrowDetailDatas">
				<el-table-column type="index" align="center" width="50px"></el-table-column>
				<el-table-column label="书名" align="center" prop="BookName"></el-table-column>
				<el-table-column label="图书条码" align="center" prop="BookCode"></el-table-column>
				<el-table-column label="图书标签" align="center" prop="BookTagCode"></el-table-column>
				<el-table-column label="读者条码" align="center" prop="ReaderCode"></el-table-column>
				<el-table-column label="借书时间" align="center" prop="BorrowTime"></el-table-column>
			</el-table>
			<div class="block" style="text-align:right">
				<el-pagination @current-change="handleBorrowCurrentChange" :current-page="borrowCurrentPage" :page-size="borrowPageSize" layout="total,prev, pager, next, jumper" :total="borrowTotalSize">
				</el-pagination>
			</div>
		</el-dialog>
		<el-dialog title="今日还书详情" v-model="returnDetailDialog" :class="[dialog-large-width]">
			<el-table border style="width: 100%" :data="returnDetailDatas">
				<el-table-column type="index" align="center" width="50px"></el-table-column>
				<el-table-column label="书名" align="center" prop="BookName"></el-table-column>
				<el-table-column label="图书条码" align="center" prop="BookCode"></el-table-column>
				<el-table-column label="图书标签" align="center" prop="BookTagCode"></el-table-column>
				<el-table-column label="读者条码" align="center" prop="ReaderCode"></el-table-column>
				<el-table-column label="还书时间" align="center" prop="RealReturnTime"></el-table-column>
			</el-table>
			<div class="block" style="text-align:right">
				<el-pagination @current-change="handleReturnCurrentChange" :current-page="returnCurrentPage" :page-size="returnPageSize" layout="total,prev, pager, next, jumper" :total="returnTotalSize">
				</el-pagination>
			</div>
		</el-dialog>
		<el-dialog title="设备故障记录" v-model="failureDialog" :class="[dialog-large-width]">
			<div style="padding-bottom: 2px">
				<span style="font-size: 13px;font-weight: bold">{{$t('message.start')}}</span>
				<el-date-picker :editable="false" :clearable="false" size="small" type="date" v-model="failureStartTime" placeholder="选择起始日期" @change="changeFailureStartTime"></el-date-picker>
				<span style="font-size: 13px;font-weight: bold">{{$t('message.end')}}</span>
				<el-date-picker :editable="false" :clearable="false" size="small" type="date" v-model="failureEndTime" placeholder="选择结束日期" @change="changeFailureEndTime"></el-date-picker>
			</div>
			<el-table border :data="failureDatas">
				<el-table-column :show-overflow-tooltip="true" type="index" align="center"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="设备" align="center" prop="name"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="故障代码" align="center" prop="code"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="故障时间" align="center" prop="time"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="故障描述" align="center" prop="desc">
				</el-table-column>
			</el-table>
			<div class="block" style="text-align:right">
				<el-pagination @size-change="handleFailureSizeChange" @current-change="handleFailureCurrentChange" :current-page="failureCurrentPage" :page-size="failurePageSize" :page-sizes="[10, 20, 30, 40, 50]" layout="total,sizes, prev, pager, next, jumper" :total="failureTotalSize">
				</el-pagination>
			</div>
		</el-dialog>
		<el-dialog title="设备异常报告" v-model="expDialog" :class="[dialog-large-width]">
			<div style="padding-bottom: 2px">
				<span style="font-size: 13px;font-weight: bold">{{$t('message.start')}}</span>
				<el-date-picker :editable="false" :clearable="false" size="small" type="date" v-model="expStartTime" placeholder="选择起始日期" @change="changeExpStartTime"></el-date-picker>
				<span style="font-size: 13px;font-weight: bold">{{$t('message.end')}}</span>
				<el-date-picker :editable="false" :clearable="false" size="small" type="date" v-model="expEndTime" placeholder="选择结束日期" @change="changeExpEndTime"></el-date-picker>
			</div>
			<el-table border :data="expDatas">
				<el-table-column :show-overflow-tooltip="true" type="index" align="center"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="设备" align="center" prop="name"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="应用名称" align="center" prop="appname"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="应用版本" align="center" prop="appver"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="异常时间" align="center" prop="time"></el-table-column>
				<el-table-column :show-overflow-tooltip="true" label="异常描述" align="center" prop="desc">
				</el-table-column>
			</el-table>
			<div class="block" style="text-align:right">
				<el-pagination @size-change="handleExpSizeChange" @current-change="handleExpCurrentChange" :current-page="expCurrentPage" :page-size="expPageSize" :page-sizes="[10, 20, 30, 40, 50]" layout="total,sizes, prev, pager, next, jumper" :total="expTotalSize">
				</el-pagination>
			</div>
		</el-dialog>
		<el-dialog title="设置管理区域" v-model="managedDistrictDialog" :show-close="false" :class="[dialog-tiny-width]">
			<el-tree :show-overflow-tooltip="true" style="height: 300px;overflow: auto;border: 0" ref="tree" show-checkbox :data="districtsDatas" :props="defaultProps" node-key="DistrictKeyId" :highlight-current="true" :default-expanded-keys="defaultExpandedKeys" :default-checked-keys="managedDistrictDatas">
			</el-tree>
			<div slot="footer" class="dialog-footer">
				<el-button @click="managedDistrictDialog = false">取 消</el-button>
				<el-button type="primary" @click="confirmManagedDistricts">修 改</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	import $ from 'jquery';
	import swf from '../../../../assets/js/swfobject.js'
	import headerOpreate from '../../../../components/headerOpreate'
	import { GloabFun, HttpServer } from '../../../../assets/js/common.js'
	import { Animation } from '../../../../assets/js/common.js'
	import noRecord from '../../../../assets/images/noRecord.jpg'
	import imgDefault from '../../../../assets/images/title-right.png'

	import { videoPlayer } from 'vue-video-player'
	require('videojs-flash/dist/videojs-flash')
	require('video.js/dist/video-js.css')
	require('vue-video-player/src/custom-theme.css')

	var date = new Date();
	var that = null;
	window['StartPlay'] = function(id, ch) {
		//console.log(id);
		if(that) {
			//开始预览
			that.handleStartPlay(id, ch);
		} else {
			console.error(that.$t('message.initializeFailed'));
		}
	}
	window['StopPlay'] = function(id, ch) {
		if(that) {
			//停止预览
			that.handleStopPlay(id, ch);
		} else {
			console.error(that.$t('message.initializeFailed'));
		}
	}
	window["recordGId"] = "";
	export default {
		components: {
			headerOpreate,
			videoPlayer
		},
		data() {
			Date.prototype.format = function(format) {
				var date = {
					"M+": this.getMonth() + 1,
					"d+": this.getDate()
				};
				if(/(y+)/i.test(format)) {
					format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
				}
				for(var k in date) {
					if(new RegExp("(" + k + ")").test(format)) {
						format = format.replace(RegExp.$1, RegExp.$1.length == 1 ?
							date[k] : ("00" + date[k]).substr(("" + date[k]).length));
					}
				}
				return format;
			}
			Date.prototype.formatTime = function(fmt) {
				var o = {
					"h+": this.getHours(), //小时 
					"m+": this.getMinutes(), //分
				};
				if(/(y+)/.test(fmt)) {
					fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
				}
				for(var k in o) {
					if(new RegExp("(" + k + ")").test(fmt)) {
						fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
					}
				}
				return fmt;
			}
			return {
				videoOptions: {},
				ledControlModelFlag: false,
				imgTitleUrl: imgDefault,
				pingtime: '',
				HKDeviceDatas: [],
				HKDevice: {
					sn: '',
					ch: '',
					waitting: false
				},
				machineCaptureDatas: [],
				version: '', //是否为新版本
				bookCount: 0,
				imgUrl: noRecord,
				startTime: date.format('yyyy-MM-dd') + ' 00:00:00',
				endTime: date.format('yyyy-MM-dd') + ' 23:59:59',
				IsOnLine: false, //设备是否在线
				loading: false, //数据加载
				isReload: false,
				devideInfoData: [],
				isSanDaiWT: false,

				bookData: [],
				value: 0,
				searchModel: '',
				bookInfoDialog: false,
				multipleBookSelection: [],
				documentlocationDialog: false,
				locationName: '',
				locationObj: {},
				locationCurrentPage: 1,
				locationPageSize: 10,
				locationTotalSize: 0,
				locationDatas: [],

				managedDistrictDatas: [],
				managedDistrictDialog: false,
				defaultExpandedKeys: [],
				defaultProps: {
					children: 'Children',
					label: 'Name',
					id: 'Id'
				},
				//在架图书
				bookCount: 0,
				currentPage: 1,
				pageSize: 10,
				totalSize: 0,
				appInfo: [],
				deviceUseSumaryData: {},
				statusDatas: {},
				configDatas: {},
				loopArray: [],
				adTestDialog: false,
				adTestData: [],
				monitorDatas: [],
				recordFileSizeDialog: false,
				recordDurationObj: {},
				defaultRecordDuration: '',
				//读者信息
				deviceReaderDialog: false,
				deviceReaderDatas: [],
				pushReaderObj: {
					waitting: false
				},
				multipleSelection: [],

				//故障记录
				failureDialog: false,
				failureDatas: [],
				failureCurrentPage: 1,
				failurePageSize: 10,
				failureTotalSize: 0,
				failureStartTime: new Date((date.getTime() - 3600 * 1000 * 24 * 7)).format('yyyy-MM-dd') + ' 00:00:00',
				failureEndTime: date.format('yyyy-MM-dd') + ' 23:59:59',

				//异常报告
				expDialog: false,
				expDatas: [],
				expCurrentPage: 1,
				expPageSize: 10,
				expTotalSize: 0,
				expStartTime: new Date((date.getTime() - 3600 * 1000 * 24 * 7)).format('yyyy-MM-dd') + ' 00:00:00',
				expEndTime: date.format('yyyy-MM-dd') + ' 23:59:59',

				//登录详情
				loginDetailDialog: false,
				loginDetailDatas: [],
				loginCurrentPage: 1,
				loginPageSize: 10,
				loginTotalSize: 0,
				//借书详情
				borrowDetailDialog: false,
				borrowDetailDatas: [],
				borrowCurrentPage: 1,
				borrowPageSize: 10,
				borrowTotalSize: 0,
				//还书详情
				returnDetailDialog: false,
				returnDetailDatas: [],
				returnCurrentPage: 1,
				returnPageSize: 10,
				returnTotalSize: 0,

				recordDurationDialog: false,
				recordFileSizeObj: {},
				defaultRecordFileSize: '',

				cardTypeRadio: 0,
				cardTypeDialog: false,
				setCardTypeObj: {},

				poweronDialog: false,
				setPowerOnObj: {},
				// powerOnTimeValue:new Date(),
				powerOnTimeValue: '',

				poweroffDialog: false,
				setPowerOffObj: {},
				// powerOffTimeValue:new Date(),
				powerOffTimeValue: '',

				lightonDialog: false,
				setLightOnObj: {},
				lightOnTimeValue: new Date(),
				// lightOnTimeValue:'',

				lightoffDialog: false,
				setLightOffObj: {},
				lightOffTimeValue: new Date(),
				// lightOffTimeValue:'',
				renameDeviceDialog: false,
				refreshObj: {
					waitting: false,
					receiveCMD: false,
					loopCount: 6,
					currentCount: 0,
					startLoop: function(fn) {
						return setInterval(fn, 2000);
					},
					loopRequest: null
				},
				ledControlModelLoading: false,
				ledthresholdDialog: false,
				ledthresholdObj: {
					ledthreshold: 0,
					waitting: false
				},
				SyncObj: {
					waitting: false
				},
				changeNameObj: {
					waitting: false,
					deviceName: ''
				},
				restartObj: {
					waitting: false
				},
				controlLockObj: {
					waitting: false
				},
				cardTypeObj: {
					waitting: false
				},
				powerOnObj: {
					waitting: false
				},
				powerOffObj: {
					waitting: false
				},
				lightOnObj: {
					waitting: false
				},
				lightOffObj: {
					waitting: false
				},
				setRecordFileSizeObj: {
					waitting: false
				},
				setRecordDurationObj: {
					waitting: false
				},
				resetPwdObj: {
					waitting: false
				},
				setLocationObj: {
					waitting: false
				},
				remoteInventory: {
					waitting: false
				}
			}
		},
		props: {
			templateObj: {
				type: Object,
				default: {}
			}
		},
		mounted() {
			//			console.log('this is current videojs instance object', this.myVideoPlayer)
		},
		computed: {
			player() {
				return this.$refs.videoPlayer.player
			}
		},
		methods: {
			executeAction(action) {
				if(action) {
					this[action]();
				}
			},
			handleCommand(command) {
				console.log(command)
				if(command == 'r') {
					this.pushBindReader();
				} else {
					this.pushBindBook();
				}
			},
			pushBindReader() {
				this.$confirm("此操作将推送设备绑定读者信息，是否继续?", "提示", {
						confirmButtonText: "确定",
						cancelButtonText: "取消",
						type: "warning"
					})
					.then(() => {
						this.loading = true;
						HttpServer.httpPost.call(this, "/Api/Peripheral/Push/BindedReaders", {
							sn: [this.templateObj.sn],
							version: this.version
						}, function(response) {}, function(response) {
							this.loading = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: '操作无响应',
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: "错误",
									message: response.data.msg,
									duration: 1500
								});
							}
						});
					})
					.catch(() => {
						this.$notify.info({
							title: "消息",
							message: this.$t("message.cancleOperation"),
							duration: 1500
						});
					});
			},
			pushBindBook() {
				this.$confirm("此操作将推送设备绑定图书信息，是否继续?", "提示", {
						confirmButtonText: "确定",
						cancelButtonText: "取消",
						type: "warning"
					})
					.then(() => {
						this.loading = true;
						HttpServer.httpPost.call(this, "/Api/Peripheral/Push/BindedBooks", {
							sn: [this.templateObj.sn],
							version: this.version
						}, function(response) {}, function(response) {
							this.loading = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: '操作无响应',
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: "错误",
									message: response.data.msg,
									duration: 1500
								});
							}
						});
					})
					.catch(() => {
						this.$notify.info({
							title: "消息",
							message: this.$t("message.cancleOperation"),
							duration: 1500
						});
					});
			},
			openFailure() {
				this.getFailureDatas();
				this.failureDialog = true;
			},
			//查询设备故障记录
			getFailureDatas() {
				var param = {
					index: this.failureCurrentPage,
					pagesize: this.failurePageSize,
					sn: [this.templateObj.sn],
					begin: this.failureStartTime,
					end: this.failureEndTime,
					type: 2,
					filter: ''
				}
				HttpServer.httpPost.call(this, '/Api/Device/Failure', param, function(response) {}, function(response) {
					// console.log('故障信息',response);
					if(response.data.code === 0) {
						this.failureDatas = response.data.failure;
						this.failureTotalSize = response.data.totalcount;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				});
			},
			changeFailureStartTime(val) {
				this.failureStartTime = val + ' 00:00:00';
				this.getFailureDatas();
			},
			changeFailureEndTime(val) {
				this.failureEndTime = val + ' 23:59:59';
				this.getFailureDatas();
			},
			handleFailureCurrentChange(val) {
				this.failureCurrentPage = val;
				this.getFailureDatas();
			},
			handleFailureSizeChange(val) {
				this.failurePageSize = val;
				this.getFailureDatas();
			},
			openExp() {
				this.getExpDatas();
				this.expDialog = true;
			},
			getExpDatas() {
				var param = {
					index: this.expCurrentPage,
					pagesize: this.expPageSize,
					sn: [this.templateObj.sn],
					begin: this.expStartTime,
					end: this.expEndTime,
					type: 2,
					filter: ''
				}
				HttpServer.httpPost.call(this, '/Api/Device/AppException', param, function(response) {}, function(response) {
					if(response.data.code === 0) {
						this.expDatas = response.data.exp;
						this.expTotalSize = response.data.totalcount;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			changeExpStartTime(val) {
				this.expStartTime = val + ' 00:00:00';
				this.getExpDatas();
			},
			changeExpEndTime(val) {
				this.expEndTime = val + ' 23:59:59';
				this.getExpDatas();
			},
			handleExpCurrentChange(val) {
				this.expCurrentPage = val;
				this.getExpDatas();
			},
			handleExpSizeChange(val) {
				this.expPageSize = val;
				this.getExpDatas();
			},

			//去掉时间中的T
			formateReaderData(array) {
				for(var i = 0; i < array.length; i++) {
					var index1 = array[i].createdtime.indexOf("T");
					array[i].createdtime = array[i].createdtime.substring(0, index1) + " " + array[i].createdtime.substring(index1 + 1, index1 + 9);
				}
			},
			getReaderDatas() {
				HttpServer.httpGet.call(this, '/Api/ReaderFeature/GetTagsByDevice?sn=' + this.templateObj.sn, function(response) {}, function(response) {
					if(response.data.code === 0) {
						this.formateReaderData(response.data.data);
						this.deviceReaderDatas = response.data.data
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			//打开设备绑定的有效读者证号
			getReaderByDevice() {
				this.getReaderDatas();
				this.deviceReaderDialog = true;
			},
			handleSelectionChange(val) {
				this.multipleSelection = val;
			},
			formateSelection() {
				var result = [],
					array = this.multipleSelection;
				for(var i = 0; i < array.length; i++) {
					result.push(array[i].tag);
				}
				return result;
			},
			pushReaderToDevice() {
				if(this.formateSelection().length > 0) {
					this.pushReaderObj.waitting = true;
					HttpServer.httpPost.call(this, '/Api/ReaderFeature/DevicePush', {
						sn: this.templateObj.sn,
						tags: this.formateSelection()
					}, function(response) {}, function(response) {
						this.pushReaderObj.waitting = false;
						if(response.data.code === 0) {
							this.$notify({
								title: '成功',
								message: this.$t('message.operationSuccess'),
								type: 'success',
								duration: 2500
							});
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '请选择批量推送的读者信息',
						type: 'warning',
						duration: 2500
					});
				}
			},
			sortDatas(arr) {
				for(var i = 0; i < arr.length; i++) {
					for(var j = i + 1; j < arr.length; j++) {
						if(arr[i].DistrictKeyId > arr[j].DistrictKeyId) {
							var tmp = arr[i];
							arr[i] = arr[j];
							arr[j] = tmp;
						}
					}
				}
				return arr;
			},
			//处理树状图数据，由于父级选中时，子项会默认选中，所以需要从返回值中去掉包含子项的id,避免未选中的子项因父级id的存在而被选中
			traverseTree(arr1, arr2) {
				//arr1为默认选中的数,arr2为区域信息数组
				for(var m = 0; m < arr1.length; m++) {
					for(var n = 0; n < arr2.length; n++) {
						if(arr1[m] == arr2[n].DistrictKeyId && arr2[n].Children.length > 0) {
							arr1.splice(m, 1);
							this.traverseTree(arr1, arr2[n].Children);
						}
					}
				}
			},
			//获取用户所有区域信息
			getUserDistrictsDatas() {
				HttpServer.httpGet.call(this, '/Api/District/districtTree?uid=' + parseInt(GloabFun.getKeyId()), function(response) {}, function(response) {
					if(response.data.code === 0) {
						if(response.data.info.length > 0) {
							this.traverseTree(this.managedDistrictDatas, response.data.info);
							this.districtsDatas = this.sortDatas(response.data.info);
							this.defaultExpandedKeys.push(this.districtsDatas[0].DistrictKeyId);
						}
					}
				});
			},
			//查看设备管理区域
			getManagedDistricts() {
				this.getUserDistrictsDatas();
				this.managedDistrictDialog = true;
			},
			//确认修改管理区域
			confirmManagedDistricts() {
				this.$confirm('此操作将修改设备管理区域，是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					HttpServer.httpPost.call(this, '/Api/Bookracks/UpdateDeviceManageDistirct', {
						sn: this.templateObj.sn,
						districtid: this.$refs.tree.getCheckedKeys()
					}, function(response) {}, function(response) {
						// console.log('绑定区域返回结果',response);
						if(response.data.code === 0) {
							this.getDatas();
							this.$notify({
								title: '成功',
								message: this.$t('message.saveSuccess'),
								type: 'success',
								duration: 2500
							});
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
					});
				}).catch(() => {
					this.$notify.info({
						title: '消息',
						message: this.$t('message.cancleOperation'),
						duration: 2500
					})
				});
			},
			goMapSet() {
				this.$emit('changeView', 'mapSet', this.templateObj)
			},
			//获取设备使用情况信息
			getDeviceUseSumary() {
				HttpServer.httpPost.call(this, '/Api/Device/UseSumary', {
					sn: this.templateObj.sn,
					begin: this.startTime,
					end: this.endTime
				}, function(response) {}, function(response) {
					// console.log('设备使用情况',response);
					if(response.data.code === 0) {
						this.deviceUseSumaryData = response.data;
					}
				});
			},
			//修改密码
			resetPassword() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.resetPwdObj.waitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/WTAdminPwdReset', {
							sn: [this.templateObj.sn],
							version: this.version
						}, function(response) {}, function(response) {
							if(response.data.code === 0) {
								// console.log('重置密码',response);
								if(response.data.response.length > 0) {
									if(response.data.response[0].sn === this.templateObj.sn && response.data.response[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
							this.resetPwdObj.waitting = false;
						})
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//修改名称
			changeName(row) {
				if(this.IsOnLine) {
					this.changeNameObj.deviceName = row.name;
					this.renameDeviceDialog = true;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//修改名称
			rename() {
				this.changeNameObj.waitting = true;
				this.$nextTick(function() {
					var paramContent = {
						name: this.changeNameObj.deviceName
					}
					HttpServer.httpPost.call(this, '/Api/User/Command/Send', {
						cmd: 10001,
						sn: [this.templateObj.sn],
						content: JSON.stringify(paramContent)
					}, function(response) {}, function(response) {
						this.changeNameObj.waitting = false;
						if(response.data.code === 0) {
							// console.log('重置密码',response);
							if(response.data.response.length > 0) {
								if(response.data.response[0].sn == this.templateObj.sn && response.data.response[0].code === 0) {
									this.$notify({
										title: '成功',
										message: this.$t('message.operationSuccess'),
										type: 'success',
										duration: 2500
									});
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.response[0].msg,
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: this.$t('message.operationFailed'),
									duration: 2500
								});
							}
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
					})
				})
			},
			//重启
			restart() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.restartObj.waitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/WTControl', {
							sn: [this.templateObj.sn],
							op: 2,
							version: ''
						}, function(response) {}, function(response) {
							// console.log('设备重启',response);
							if(response.data.response.length > 0) {
								if(response.data.response[0].sn == this.templateObj.sn && response.data.response[0].code === 0) {
									this.$notify({
										title: '成功',
										message: this.$t('message.operationSuccess'),
										type: 'success',
										duration: 2500
									});
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.response[0].msg,
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: this.$t('message.operationFailed'),
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
							this.restartObj.waitting = false;
						})
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//关闭
			close() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.restartObj.waitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/WTControl', {
							sn: [this.templateObj.sn],
							op: 1,
							version: ''
						}, function(response) {}, function(response) {
							// console.log('关闭设备',response);
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
							this.restartObj.waitting = false;
						})
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//打开红外测试弹窗
			openAdTest() {
				this.adTestDialog = true;
				this.adTestData = this.statusDatas.adtest;
			},
			//去掉时间中的T
			formateData(array) {
				for(var i = 0; i < array.length; i++) {
					var index1 = array[i].bindtime.indexOf("T");
					array[i].bindtime = array[i].bindtime.substring(0, index1) + " " + array[i].bindtime.substring(index1 + 1, index1 + 9);
				}
			},
			//修改灯带阈值
			setLedthreshold() {
				if(this.IsOnLine) {
					this.ledthresholdObj.ledthreshold = this.configDatas.ledthreshold;
					this.ledthresholdDialog = true;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			changeLedthreshold() {
				clearInterval(this.WTDetailIntervalid);
				this.$confirm('此操作将修改灯带阈值，是否继续 ？', this.$t('message.warning'), {
					confirmButtonText: this.$t('message.yes'),
					cancelButtonText: this.$t('message.no'),
					type: 'warning'
				}).then(() => {
					this.ledthresholdObj.waitting = true;
					HttpServer.httpPost.call(this, '/Api/Peripheral/ThresholdSet', {
						sn: [this.templateObj.sn],
						data: this.ledthresholdObj.ledthreshold,
						version: this.version
					}, function(response) {}, function(response) {
						this.ledthresholdObj.waitting = false;
						this.ledthresholdDialog = false;
						if(response.data.code === 0) {
							if(response.data.response.length > 0) {
								if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
									this.$notify({
										title: '成功',
										message: this.$t('message.operationSuccess'),
										type: 'success',
										duration: 2500
									});
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.response[0].msg,
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: this.$t('message.operationFailed'),
									duration: 2500
								});
							}
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
						this.WTDetailIntervalid = setInterval(() => {
							this.getDeviceUseSumary();
							this.getDatas();
						}, 5000)
					});
				}).catch(() => {
					this.WTDetailIntervalid = setInterval(() => {
						this.getDeviceUseSumary();
						this.getDatas();
					}, 5000)
					//取消批量删除处理
					this.$notify.info({
						title: '消息',
						message: this.$t('message.cancleOperation'),
						duration: 2500
					})
				});
			},
			//三代微图广告屏控制方式
			selectControlModel() {
				if(this.ledControlModelFlag) {
					if(this.IsOnLine) {
						clearInterval(this.WTDetailIntervalid);
						this.$confirm('此操作将修改广告屏控制方式，是否继续 ？', this.$t('message.warning'), {
							confirmButtonText: this.$t('message.yes'),
							cancelButtonText: this.$t('message.no'),
							type: 'warning'
						}).then(() => {
							this.ledControlModelLoading = true;
							HttpServer.httpPost.call(this, '/Api/Peripheral/LEDControlModel', {
								sn: [this.templateObj.sn],
								type: this.configDatas.ledcontroltype,
								version: this.version
							}, function(response) {}, function(response) {
								this.ledControlModelLoading = false;
								if(response.data.code === 0) {
									if(response.data.response.length > 0) {
										if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
											this.$notify({
												title: '成功',
												message: this.$t('message.operationSuccess'),
												type: 'success',
												duration: 2500
											});
										} else {
											this.$notify.error({
												title: '错误',
												message: response.data.response[0].msg,
												duration: 2500
											});
										}
									} else {
										this.$notify.error({
											title: '错误',
											message: this.$t('message.operationFailed'),
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.msg,
										duration: 2500
									});
								}
								this.WTDetailIntervalid = setInterval(() => {
									this.getDeviceUseSumary();
									this.getDatas();
								}, 5000)
							});
						}).catch(() => {
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
							//取消批量删除处理
							this.$notify.info({
								title: '消息',
								message: this.$t('message.cancleOperation'),
								duration: 2500
							})
						});
					} else {
						this.$notify({
							title: this.$t('message.warning'),
							message: '设备处于离线状态，不可控制。',
							type: 'warning',
							duration: 2500
						});
					}
				}
			},
			//查看书籍信息
			findBookInfo() {
				HttpServer.httpPost.call(this, '/Api/Book/Info/InBookrack', {
					sn: this.templateObj.sn,
					index: this.currentPage,
					pagesize: this.pageSize,
					keyword: this.value === 0 ? this.searchModel : '',
					barcode: this.value === 1 ? this.searchModel : '',
					tag: this.value === 2 ? this.searchModel : '',
				}, function(response) {}, function(response) {
					// console.log('response',response);
					if(response.data.code === 0) {
						this.bookData = response.data.info;
						this.totalSize = response.data.totalcount;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			handleBookSelectionChange(val) {
				this.multipleBookSelection = val;
			},
			//去掉时间中的T
			formateLocationData(array) {
				for(var i = 0; i < array.length; i++) {
					var index1 = array[i].CreateTime.indexOf("T");
					var index2 = array[i].UpdateTime.indexOf("T");
					array[i].CreateTime = array[i].CreateTime.substring(0, index1) + " " + array[i].CreateTime.substring(index1 + 1, index1 + 9);
					array[i].UpdateTime = array[i].UpdateTime.substring(0, index2) + " " + array[i].UpdateTime.substring(index2 + 1, index2 + 9);
				}
			},
			//获取当前用户绑定的馆藏地
			getAllLocationDatas() {
				HttpServer.httpPost.call(this, '/Api/LibraryLocation/List', {
					UserId: parseInt(GloabFun.getKeyId()),
					index: this.locationCurrentPage,
					pagesize: this.locationPageSize,
					districtid: 0,
					keyword: ''
				}, function(response) {}, function(response) {
					this.loading = false;
					if(response.data.code === 0) {
						this.formateLocationData(response.data.info);
						this.locationDatas = response.data.info;
						this.locationObj = response.data.info[0];
						this.locationName = response.data.info[0].Name;
						this.locationTotalSize = response.data.total;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				});
			},
			//单选
			getCurrentRow(row) {
				this.locationObj = row;
				this.locationName = row.Name;
			},
			handleLocationCurrentChange(val) {
				this.locationCurrentPage = val;
				this.getAllLocationDatas();
			},
			handleLocationSizeChange(val) {
				this.locationPageSize = val;
				this.getAllLocationDatas();
			},
			//确定修改图书馆藏地
			confirmBindLocation() {
				this.$confirm('此操作将所选图书与' + this.locationName + '进行绑定，是否继续？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					var result = [];
					for(var i = 0; i < this.multipleBookSelection.length; i++) {
						result[i] = {};
						result[i].locationkeyId = this.locationObj.LocationKeyId;
						result[i].bookkeyId = this.multipleBookSelection[i].keyid;
					}
					HttpServer.httpPost.call(this, '/Api/LibraryLocation/BindBook', {
						info: result
					}, function(response) {}, function(response) {
						if(response.data.code === 0) {
							this.findBookInfo();
							this.$notify({
								title: '成功',
								message: this.$t('message.saveSuccess'),
								type: 'success',
								duration: 2500
							});
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
					});
				}).catch(() => {
					this.$notify.info({
						title: '消息',
						message: this.$t('message.operationCanceled'),
						duration: 2500
					})
				});
			},
			//在架图书修改馆藏地
			bindLocation() {
				if(this.multipleBookSelection.length > 0) {
					this.getAllLocationDatas();
					this.documentlocationDialog = true;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '请选择批量绑定的图书',
						type: 'warning',
						duration: 2500
					});
				}
			},

			//远程盘点
			RemoteInventory() {
				clearInterval(this.WTDetailIntervalid);
				this.$nextTick(function() {
					this.remoteInventory.waitting = true;
					HttpServer.httpPost.call(this, '/Api/Peripheral/RemoteInventory', {
						sn: [this.templateObj.sn],
						version: this.version
					}, function(response) {}, function(response) {
						this.remoteInventory.waitting = false;
						if(response.data.code === 0) {
							if(response.data.response.length > 0) {
								if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
									this.$notify({
										title: '成功',
										message: this.$t('message.operationSuccess'),
										type: 'success',
										duration: 2500
									});
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.response[0].msg,
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: '操作无响应',
									duration: 2500
								});
							}
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
						if(this.IsOnLine) {
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						}
					});
				})
			},
			openBookInfo() {
				clearInterval(this.WTDetailIntervalid);
				this.bookInfoDialog = true;
				this.findBookInfo();
			},
			handleCurrentChange(val) {
				this.currentPage = val;
				this.findBookInfo();
			},
			handleSizeChange(val) {
				this.pageSize = val;
				this.findBookInfo();
			},
			clearLoopOpreation(row) {
				clearInterval(row.loopRequest);
				row.loopRequest = null;
				row.currentCount = 0;
			},
			//录像开关
			controlVoice() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.configDatas.voiceWaitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/EnableVoice', {
							sn: [this.templateObj.sn],
							onoff: this.configDatas.enablevoice ? 1 : 0,
							version: this.version
						}, function(response) {}, function(response) {
							// console.log('控制录像开关',response);
							this.configDatas.voiceWaitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.configDatas.enablevoice = !this.configDatas.enablevoice;
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.configDatas.voiceSwitch = !this.configDatas.voiceSwitch;
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.configDatas.voiceSwitch = !this.configDatas.voiceSwitch;
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.configDatas.voiceSwitch = !this.configDatas.voiceSwitch;
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						});
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
					this.configDatas.voiceSwitch = !this.configDatas.voiceSwitch;
				}
			},
			//灯带控制
			controlLight() {
				if(this.IsOnLine) {
					this.isSanDaiWT ? this.statusDatas.ledstatus.waitting = true : this.statusDatas.lightWaitting = true;
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						HttpServer.httpPost.call(this, '/Api/Peripheral/WTLEDSet', {
							onoff: this.isSanDaiWT ? (this.statusDatas.ledstatus.switch ? 0 : 1) : (this.statusDatas.lightstatus ? 0 : 1),
							sn: [this.templateObj.sn],
							version: this.version
						}, function(response) {}, function(response) {
							this.statusDatas.lightWaitting = false;
							this.statusDatas.ledstatus.waitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.statusDatas.lightstatus = !this.statusDatas.lightstatus;
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.statusDatas.lightSwitch = !this.statusDatas.lightSwitch;
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.statusDatas.lightSwitch = !this.statusDatas.lightSwitch;
									this.$notify.error({
										title: '错误',
										message: '操作无响应',
										duration: 2500
									});
								}
							} else {
								this.statusDatas.lightSwitch = !this.statusDatas.lightSwitch;
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						})
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
					this.statusDatas.lightSwitch = !this.statusDatas.lightSwitch;
				}
			},
			//控制定时开关灯
			controlTimingLight() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.configDatas.timingLightWaitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/EnableTimingLight', {
							onoff: this.configDatas.enabletiminglight ? 0 : 1,
							sn: [this.templateObj.sn],
							version: this.version
						}, function(response) {}, function(response) {
							this.configDatas.timingLightWaitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.configDatas.enabletiminglight = !this.configDatas.enabletiminglight;
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.configDatas.timingLightSwitch = !this.configDatas.timingLightSwitch;
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.configDatas.timingLightSwitch = !this.configDatas.timingLightSwitch;
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.configDatas.timingLightSwitch = !this.configDatas.timingLightSwitch;
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						})
					})
				} else {
					this.configDatas.timingLightSwitch = !this.configDatas.timingLightSwitch;
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//设置开灯时间弹窗
			setLightOnTimeDialog() {
				if(this.IsOnLine) {
					this.lightonDialog = true;
					this.setLightOnObj = this.configDatas;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//确定修改开灯时间
			changeLightOnTime() {
				if(this.lightOnTimeValue == '') {
					this.$notify({
						title: this.$t('message.warning'),
						message: '请选择开灯时间',
						type: 'warning',
						duration: 2500
					});
				} else {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.lightOnObj.waitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/LightOnTime', {
							time: (this.lightOnTimeValue).formatTime('hh:mm'),
							sn: [this.templateObj.sn],
							version: this.version
						}, function(response) {}, function(response) {
							// console.log('开灯时间',response);
							this.lightOnObj.waitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						})
					})
				}
			},
			//设置关灯时间弹窗
			setLightOffTimeDialog() {
				if(this.IsOnLine) {
					this.lightoffDialog = true;
					this.setLightOffObj = this.configDatas;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//确定修改关灯说时间
			changeLightOffTime() {
				if(this.lightOffTimeValue == '') {
					this.$notify({
						title: this.$t('message.warning'),
						message: '请选择关灯时间',
						type: 'warning',
						duration: 2500
					});
				} else {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.lightOffObj.waitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/LightOffTime', {
							sn: [this.templateObj.sn],
							time: (this.lightOffTimeValue).formatTime('hh:mm'),
							version: this.version
						}, function(response) {}, function(response) {
							// console.log('关灯时间',response);
							this.lightOffObj.waitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						})
					})
				}
			},
			//设置录像文件大小
			openRecordFileSizeDialog() {
				if(this.IsOnLine) {
					this.recordFileSizeDialog = true;
					this.recordFileSizeObj = this.configDatas;
					this.defaultRecordFileSize = this.configDatas.recordfilesize;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//确定修改录像文件大小
			changeRecordFileSize() {
				// console.log('this.defaultRecordFileSize',this.defaultRecordFileSize)
				clearInterval(this.WTDetailIntervalid);
				this.$nextTick(function() {
					this.setRecordFileSizeObj.waitting = true;
					HttpServer.httpPost.call(this, '/Api/Peripheral/RecordSizeSet', {
						sn: [this.templateObj.sn],
						size: this.defaultRecordFileSize,
						version: this.version
					}, function(response) {}, function(response) {
						// console.log('修改录像文件大小',response);
						this.setRecordFileSizeObj.waitting = false;
						if(response.data.code === 0) {
							if(response.data.response.length > 0) {
								if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
									this.$notify({
										title: '成功',
										message: this.$t('message.operationSuccess'),
										type: 'success',
										duration: 2500
									});
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.response[0].msg,
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: this.$t('message.operationFailed'),
									duration: 2500
								});
							}
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
						this.WTDetailIntervalid = setInterval(() => {
							this.getDeviceUseSumary();
							this.getDatas();
						}, 5000)
					})
				})
			},
			//设置录像时间间隔
			openRecordDurationDialog() {
				if(this.IsOnLine) {
					this.recordDurationDialog = true;
					this.recordDurationObj = this.configDatas;
					this.defaultRecordDuration = this.configDatas.recordfileduration;
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//确定修改录像时间间隔
			changeRecordDuration() {
				clearInterval(this.WTDetailIntervalid);
				this.$nextTick(function() {
					this.setRecordDurationObj.waitting = true;
					HttpServer.httpPost.call(this, '/Api/Peripheral/RecordTimeSet', {
						time: this.defaultRecordDuration,
						sn: [this.templateObj.sn],
						version: this.version
					}, function(response) {}, function(response) {
						// console.log('修改录像时间间隔',response);
						this.setRecordDurationObj.waitting = false;
						if(response.data.code === 0) {
							if(response.data.response.length > 0) {
								if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
									this.$notify({
										title: '成功',
										message: this.$t('message.operationSuccess'),
										type: 'success',
										duration: 2500
									});
								} else {
									this.$notify.error({
										title: '错误',
										message: response.data.response[0].msg,
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: this.$t('message.operationFailed'),
									duration: 2500
								});
							}
						} else {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
						this.WTDetailIntervalid = setInterval(() => {
							this.getDeviceUseSumary();
							this.getDatas();
						}, 5000)
					})
				})
			},
			//控制图书角门锁
			controlWT0201ALock() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.controlLockObj.waitting = true;
						HttpServer.httpPost.call(this, '/Api/Peripheral/WTDoorSet', {
							onoff: this.statusDatas.doorStatus ? 1 : 0,
							sn: [this.templateObj.sn],
							version: ''
						}, function(response) {}, function(response) {
							// console.log('控制门锁',response);
							this.controlLockObj.waitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.statusDatas.aDoorStatus = !this.statusDatas.aDoorStatus;
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.statusDatas.aDoorSwitch = !this.statusDatas.aDoorSwitch;
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.statusDatas.aDoorSwitch = !this.statusDatas.aDoorSwitch;
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.statusDatas.aDoorSwitch = !this.statusDatas.aDoorSwitch;
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						})
					})
				} else {
					this.statusDatas.aDoorSwitch = !this.statusDatas.aDoorSwitch;
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//控制门锁
			controlDoorLock() {
				if(this.IsOnLine) {
					clearInterval(this.WTDetailIntervalid);
					this.$nextTick(function() {
						this.controlLockObj.waitting = true;
						console.log('this.statusDatas.doorstatus.switch', this.statusDatas.doorStatus)
						if(this.isSanDaiWT) {
							var param = {
								onoff: this.statusDatas.doorstatus.switch ? 1 : 0,
								sn: [this.templateObj.sn],
								version: this.version
							}
						} else {
							var param = {
								onoff: this.statusDatas.doorSwitch ? 1 : 0,
								sn: [this.templateObj.sn],
								version: this.version
							}
						}
						HttpServer.httpPost.call(this, '/Api/Peripheral/WTDoorSet', param, function(response) {}, function(response) {
							// console.log('控制门锁',response);
							this.controlLockObj.waitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.statusDatas.doorStatus = !this.statusDatas.doorStatus;
										this.statusDatas.leftlockstatusA = !this.statusDatas.leftlockstatusA;
										this.statusDatas.rightlockstatusA = !this.statusDatas.rightlockstatusA;
										this.statusDatas.leftlockstatusB = !this.statusDatas.leftlockstatusB;
										this.statusDatas.rightlockstatusB = !this.statusDatas.rightlockstatusB;
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.statusDatas.doorSwitch = !this.statusDatas.doorSwitch;
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.statusDatas.doorSwitch = !this.statusDatas.doorSwitch;
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.statusDatas.doorSwitch = !this.statusDatas.doorSwitch;
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
							this.WTDetailIntervalid = setInterval(() => {
								this.getDeviceUseSumary();
								this.getDatas();
							}, 5000)
						})
					})
				} else {
					this.statusDatas.doorSwitch = !this.statusDatas.doorSwitch;
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//同步设备状态
			SyncDeviceUseSumary() {
				if(this.IsOnLine) {
					this.SyncObj.waitting = true;
					this.$nextTick(function() {
						var paramContent = {
							action: "update"
						}
						HttpServer.httpPost.call(this, '/Api/User/Command/Send', {
							cmd: 10027,
							sn: [this.templateObj.sn],
							content: JSON.stringify(paramContent)
						}, function(response) {}, function(response) {
							// console.log('同步',response);
							this.SyncObj.waitting = false;
							if(response.data.code === 0) {
								if(response.data.response.length > 0) {
									if((response.data.response)[0].sn == this.templateObj.sn && (response.data.response)[0].code === 0) {
										this.$notify({
											title: '成功',
											message: this.$t('message.operationSuccess'),
											type: 'success',
											duration: 2500
										});
									} else {
										this.$notify.error({
											title: '错误',
											message: response.data.response[0].msg,
											duration: 2500
										});
									}
								} else {
									this.$notify.error({
										title: '错误',
										message: this.$t('message.operationFailed'),
										duration: 2500
									});
								}
							} else {
								this.$notify.error({
									title: '错误',
									message: response.data.msg,
									duration: 2500
								});
							}
						})
					})
				} else {
					this.$notify({
						title: this.$t('message.warning'),
						message: '设备处于离线状态，不可控制。',
						type: 'warning',
						duration: 2500
					});
				}
			},
			//判断当前版本是否为新版本
			isNewVersion(str) {
				// console.log(str)
				var result = 0;
				var strs = new Array(); //定义一数组 
				strs = str.split(".");
				if(parseInt(strs[0]) > 1) {
					result = 1;
				} else if(parseInt(strs[0]) < 1) {
					result = 0;
				} else {
					if(parseInt(strs[1]) > 5) {
						result = 1;
					} else if(parseInt(strs[1]) < 5) {
						result = 0;
					} else {
						if(parseInt(strs[2]) > 29) {
							result = 1;
						} else if(parseInt(strs[2]) < 29) {
							result = 0;
						} else {
							if(parseInt(strs[3]) >= 18) {
								result = 1;
							} else {
								result = 0;
							}
						}
					}
				}
				return result;
			},
			selectHKDevice() {
				this.getHKDeviceDetail();
			},
			handleStartPlay(id, ch) {
				//开始预览处理
				var entry = {
					op: 3,
					ch: ch,
					sn: [id]
				}
				// console.log(entry)
				this.HKDevice.waitting = true;
				HttpServer.httpPost.call(this, '/Api/Peripheral/HKRecordSet', entry, function(response) {}, function(response) {
					this.HKDevice.waitting = false;
					// console.log('开始预览',response)
				});
			},
			handleStopPlay(id, ch) {
				//停止预览处理
				var entry = {
					op: 4,
					ch: ch,
					sn: [id]
				}
				HttpServer.httpPost.call(this, '/Api/Peripheral/HKRecordSet', entry, function(response) {}, function(response) {

				});
			},
			// listen event
			onPlayerPlay(player) {
				//				 console.log('player play!', player)
				this.handleStartPlay(this.HKDevice.sn, this.HKDevice.ch);
			},
			onPlayerPause(player) {
				//				 console.log('player pause!', player)
				this.handleStopPlay(this.HKDevice.sn, this.HKDevice.ch);
			},
			// or listen state event
			playerStateChanged(playerCurrentState) {
				//								 console.log('player current update state', playerCurrentState)
			},
			// player is ready
			playerReadied(player) {},
			//获取监控详情
			getHKDeviceDetail() {
				HttpServer.httpGet.call(this, '/Api/HKRecord/Get/Status/' + this.HKDevice.sn, function(response) {}, function(response) {
					// console.log('监控设备详情',response)
					this.HKDevice.ch = response.data.data.no;
					this.videoOptions = {
						techOrder: ['flash'], // 兼容顺序
						muted: true,
						playbackRates: [0.7, 1.0, 1.5, 2.0],
						sources: [{ // 流配置，数组形式，会根据兼容顺序自动切换
							type: "rtmp/mp4",
							src: response.data.data.url
						}],
						language: 'zh-CN',
						controls: true,
						//						live: true,
						autoplay: true
					}
					this.handleStartPlay(this.HKDevice.sn, this.HKDevice.ch);
				});
			},
			formateCaptureData(array) {
				for(var i = 0; i < array.length; i++) {
					var index1 = array[i].time.indexOf("T");
					array[i].time = array[i].time.substring(0, index1) + " " + array[i].time.substring(index1 + 1, index1 + 9);
				}
			},
			//获取历史监控抓拍图片
			getMachineCapture() {
				HttpServer.httpPost.call(this, '/Api/MachineCapture/List', {
					sn: this.templateObj.sn,
					UserId: parseInt(GloabFun.getKeyId()),
					index: 1,
					pagesize: 14,
				}, function(response) {}, function(response) {
					if(response.data.code === 0) {
						this.formateCaptureData(response.data.list);
						this.machineCaptureDatas = response.data.list;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			//查看更多抓拍图片
			goMachineCapture() {
				this.$emit('changeView', 'WTMachineCapture', this.templateObj)
			},
			//获取监控设备
			getHKDevices() {
				HttpServer.httpPost.call(this, '/Api/District/GetHKRecord', {
					userKeyId: GloabFun.getKeyId(),
					districtid: this.templateObj.districtId,
					isonline: 0
				}, function(response) {}, function(response) {
					// console.log('监控设备',response)
					if(response.data.code === 0 && response.data.data.length > 0) {
						this.HKDeviceDatas = response.data.data;
						this.HKDevice.sn = response.data.data[0].sn;
						this.getHKDeviceDetail();
					} else {
						this.getMachineCapture();
					}
				})
			},
			//查看登录详情
			loginDetail() {
				this.loginDetailDialog = true;
				this.getLoginDetailData();
			},
			handleLoginCurrentChange(val) {
				this.loginCurrentPage = val;
				this.getLoginDetailData();
			},
			//获取登录详情数据
			getLoginDetailData() {
				HttpServer.httpPost.call(this, '/Api/Device/DeviceDetail', {
					begin: this.startTime,
					end: this.endTime,
					pagesize: this.loginPageSize,
					index: this.loginCurrentPage,
					devicesn: this.templateObj.sn
				}, function(response) {}, function(response) {
					if(response.data.code === 0) {
						this.loginDetailDatas = response.data.info;
						this.loginTotalSize = response.data.total;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			borrowDetail() {
				this.borrowDetailDialog = true;
				this.getBorrowDetailData();
			},
			handleBorrowCurrentChange(val) {
				this.borrowCurrentPage = val;
				this.getBorrowDetailData();
			},
			//去掉时间中的T
			formateData2(array) {
				for(var i = 0; i < array.length; i++) {
					var index1 = array[i].BorrowTime.indexOf("T");
					array[i].BorrowTime = array[i].BorrowTime.substring(0, index1) + " " + array[i].BorrowTime.substring(index1 + 1, index1 + 9);
				}
			},
			getBorrowDetailData() {
				HttpServer.httpPost.call(this, '/Api/Device/DeviceSumaryByModel/DeviceBorrowInfo', {
					begin: this.startTime,
					end: this.endTime,
					pagesize: this.borrowPageSize,
					index: this.borrowCurrentPage,
					devicesn: this.templateObj.sn,
					type: 0
				}, function(response) {}, function(response) {
					if(response.data.code === 0) {
						this.formateData2(response.data.info);
						this.borrowDetailDatas = response.data.info;
						this.borrowTotalSize = response.data.total;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			returnDetail() {
				this.returnDetailDialog = true;
				this.getReturnDetailData();
			},
			handleReturnCurrentChange(val) {
				this.returnCurrentPage = val;
				this.getReturnDetailData();
			},
			//去掉时间中的T
			formateData3(array) {
				for(var i = 0; i < array.length; i++) {
					var index1 = array[i].RealReturnTime.indexOf("T");
					array[i].RealReturnTime = array[i].RealReturnTime.substring(0, index1) + " " + array[i].RealReturnTime.substring(index1 + 1, index1 + 9);
				}
			},
			getReturnDetailData() {
				HttpServer.httpPost.call(this, '/Api/Device/DeviceSumaryByModel/DeviceBorrowInfo', {
					begin: this.startTime,
					end: this.endTime,
					pagesize: this.returnPageSize,
					index: this.returnCurrentPage,
					devicesn: this.templateObj.sn,
					type: 1
				}, function(response) {}, function(response) {
					this.loading = false;
					if(response.data.code === 0) {
						this.formateData3(response.data.info);
						this.returnDetailDatas = response.data.info;
						this.returnTotalSize = response.data.total;
					} else {
						this.$notify.error({
							title: '错误',
							message: response.data.msg,
							duration: 2500
						});
					}
				})
			},
			//查询在架图书总量
			getBookCount() {
				HttpServer.httpPost.call(this, '/Api/Book/Info/InBookrack', {
					sn: this.templateObj.sn
				}, function(response) {}, function(response) {
					this.bookCount = response.data.totalcount;
				})
			},
			//刷新
			reloadDatas() {
				this.loading = true;
				this.ledControlModelFlag = false;
				//刷新设备使用情况
				this.getDeviceUseSumary();
				this.isReload = true;
				this.getDatas();
			},
			//判断是否是三代，三代以后要去statusnew   2.9.6.80
			isSanDaiVersion(str) {
				var result = 0;
				var strs = new Array(); //定义一数组 
				strs = str.split(".");
				if(parseInt(strs[0]) > 2) {
					result = 1;
				} else if(parseInt(strs[0]) < 2) {
					result = 0;
				} else {
					if(parseInt(strs[1]) > 9) {
						result = 1;
					} else if(parseInt(strs[1]) < 9) {
						result = 0;
					} else {
						if(parseInt(strs[2]) > 6) {
							result = 1;
						} else if(parseInt(strs[2]) < 6) {
							result = 0;
						} else {
							if(parseInt(strs[3]) >= 80) {
								result = 1;
							} else {
								result = 0;
							}
						}
					}
				}
				return result;
			},
			//数据初始化
			getDatas() {
				this.ledControlModelFlag = false;
				if(this.isReload) {
					this.loading = true;
				}
				HttpServer.httpPost.call(this, '/api/bookracks/allInfo', {
					sn: this.templateObj.sn
				}, function(response) {}, function(response) {
					if(response.data.code === 0) {
						this.loading = false;
						this.getBookCount();
						this.pingTime = response.data.pingtime;
						this.managedDistrictDatas = response.data.manageddistrict;
						if(response.data.config != null) {
							//							if(this.isNewVersion(response.data.status.appver) === 1) {
							//								var str = '';
							//								if(response.data.config.supportcardtype != '') {
							//									JSON.parse(response.data.config.supportcardtype).forEach(function(item) {
							//										if(item === 0) {
							//											str = "'RFID卡'";
							//										} else if(item === 1) {
							//											str = str + " 'IC卡'";
							//										} else if(item === 2) {
							//											str = str + " 'SLE44420'";
							//										} else if(item === 3) {
							//											str = str + " 'M1卡'"
							//										}
							//									})
							//									response.data.config.supportcardtype = str;
							//								} else {
							//									response.data.config.supportcardtype = '';
							//								}
							//							}
							response.data.config.voiceSwitch = response.data.config.enablevoice ? false : true;
							response.data.config.timingPowerSwitch = response.data.config.enabletimingpower ? false : true;
							response.data.config.timingLightSwitch = response.data.config.enabletiminglight ? false : true;
							response.data.config.voiceWaitting = false;
							response.data.config.timingPowerWaitting = false;
							response.data.config.timingLightWaitting = false;
							this.configDatas = response.data.config;
							this.$nextTick(function() {
								this.ledControlModelFlag = true;
							})
						}
						if(response.data.status != null) {
							if(response.data.status.doorstatus === null) {
								this.isSanDaiWT = false;
								response.data.status.lightWaitting = false;
								response.data.status.aDoorSwitch = response.data.status.leftlockstatusA ? false : true;
								response.data.status.aDoorStatus = response.data.status.leftlockstatusA ? 1 : 0;
								response.data.status.lightSwitch = response.data.status.lightstatus ? false : true;
								response.data.status.doorSwitch = (response.data.status.leftlockstatusA || response.data.status.rightlockstatusA) ? false : true;
								response.data.status.doorStatus = (response.data.status.leftlockstatusA || response.data.status.rightlockstatusA) ? 1 : 0;
								response.data.status.adSwitch = response.data.adled ? false : true;
								response.data.status.adledWaitting = false;
								this.version = response.data.status.appver;
								this.devideInfoData = [];
								this.templateObj.appname = response.data.status.appname;
								this.templateObj.appver = response.data.status.appver;
								this.templateObj.fwver = response.data.status.fwver;
								this.devideInfoData.push(this.templateObj);
								this.statusDatas = response.data.status;
							} else {
								this.isSanDaiWT = true;
								response.data.status.doorstatus.switch = response.data.status.doorstatus.code === 0 ? false : true;
								response.data.status.ledstatus.waitting = false;
								response.data.status.ledstatus.switch = response.data.status.ledstatus.code === 1 ? false : true;
								this.version = response.data.status.appver;
								this.devideInfoData = [];
								this.templateObj.appname = response.data.status.appname;
								this.templateObj.appver = response.data.status.appver;
								this.templateObj.fwver = response.data.status.fwver;
								this.devideInfoData.push(this.templateObj);
								this.statusDatas = response.data.status;
							}
						}
						if(this.isReload) {
							this.$notify({
								title: '成功',
								message: this.$t('message.refreshSuccess'),
								type: 'success',
								duration: 2500
							});
						}
					} else {
						if(this.isReload) {
							this.$notify.error({
								title: '错误',
								message: response.data.msg,
								duration: 2500
							});
						}
					}
					this.isReload = false;
				});
			}
		},
		created() {
			this.IsOnLine = this.templateObj.online;
			this.getDatas();
			this.getDeviceUseSumary();
			this.getMachineCapture();
			if(this.templateObj.online) {
				this.WTDetailIntervalid = setInterval(() => {
					this.getDeviceUseSumary();
					this.getDatas()
				}, 5000)
			}
		},
		beforeDestroy() {
			clearInterval(this.WTDetailIntervalid);
			this.handleStopPlay(this.HKDevice.sn, this.HKDevice.ch);
		}
	}
</script>

<style scoped>
	@import '../../../../assets/css/font-awesome-4.7.0/css/font-awesome.css';
</style>
<style scoped lang="less">
	@import '../../../../assets/css/media-screen.less';
</style>

<style scoped lang="less">
	* {
		box-sizing: border-box;
	}
	
	.el-date-editor.el-input {
		width: 115px;
	}
	
	.inner-section {
		// margin: 5px 5px;
		// height: 100%;
		// border: 1px solid #BEBEBE;
		.flash-object {
			// margin: 5px 0;
			height: 368px;
			// height: e("calc(100% - 40px)");
			position: relative;
			.previewModal {
				background-color: #eee;
				height: 100%;
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				text-align: center;
				i {
					font-size: 50px;
					position: absolute;
					top: 0;
					bottom: 0;
					left: 0;
					right: 0;
					width: 50px;
					height: 50px;
					margin: auto;
				}
			}
		}
		//走马灯
		.opreat-button {
			//text-align: center;
		}
	}
	
	.navList {
		width: 100%;
		padding: 3px 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	
	.el-row {
		margin-bottom: 5px;
		.bg-purple {
			width: 100%;
			// background: #EAF4FF;
			.detail-title {
				text-align: center;
			}
			.middle-section {
				width: 100%;
				display: flex;
				.middle-bg {}
			}
			.icon-default {
				color: #999999;
			}
			.panel-title {
				width: 100%;
				height: 28px;
				color: white;
				// background-color: rgba(32,160,255,.2);
				background-color: #20A0FF;
				border-radius: 3px;
				// border-bottom: 1px solid #20A0FF;
				line-height: 28px;
				padding-left: 10px;
				.title-img {
					width: 30%;
					float: right;
					height: 100%;
					width: 100px
				}
			}
			.detail-section {
				width: 100%;
				height: 80px;
				display: flex;
				justify-content: space-around;
				.section-left {
					display: flex;
					flex-direction: column;
					justify-content: space-around;
					align-items: center;
					width: 40%;
					height: 100%;
				}
				.section-right {
					text-align: left;
					display: flex;
					flex-direction: column;
					justify-content: space-around;
					// align-items: center;
					width: 60%;
					padding: 3px;
					// padding-left: 6px;
					height: 100%;
				}
			}
			.detail-section-3 {
				height: 100px;
				width: 100%;
				display: flex;
				justify-content: space-around;
				>div {
					display: flex;
					align-items: center;
					justify-content: space-around;
					flex-direction: column;
					width: 33%;
					height: 100%;
					.icon {
						height: 44px;
						line-height: 55px;
						i {
							font-size: 43px;
						}
					}
				}
			}
			.detail-section-2 {
				height: 150px;
				width: 100%;
				>div:nth-of-type(1) {
					border-bottom: 1px solid #7f93aa;
					display: flex;
					flex-direction: column;
					justify-content: space-around;
				}
				>div {
					height: 50%;
					display: flex;
					flex-direction: column;
					justify-content: space-around;
				}
			}
		}
	}
	
	.grid-content {
		border: 1px solid #FFFFFF;
		height: 400px;
	}
	
	.grid-content1 {
		box-shadow: 0 1px 4px #000;
		border-radius: 5px;
		margin-top: 1px;
		height: 100%;
	}
	
	.row-bg {
		padding: 10px 0;
		background-color: #f9fafc;
	}
</style>